package cn.samler.diandi.api.model.io.request.pub;

import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 经纬度Model
 * 需要保留到小数点7位 以保证1米的精确度
 *
 * @author samler
 */
@Data
public class Point {
    // 经度
    @NotNull(message = "lng must be not null")
    @Min(value = -180, message = "lng is range of [-180, 180]")
    @Max(value = 180, message = "lng is range of [-180, 180]")
    private Double lng;

    // 纬度
    @NotNull(message = "lat must be not null")
    @Min(value = -90, message = "lat is range of [-90, 90]")
    @Max(value = 90, message = "lat is range of [-90, 90]")
    private Double lat;
}
